package com.gamejelly.broker.client;

import com.alipay.remoting.exception.RemotingException;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;

public interface RpcManager {

    void send(String mainRoute, String subRoute, String endPoint, Object data) throws RemotingException, InterruptedException;

    <T> T request(String mainRoute, String subRoute, String endPoint, Object data, Class<T> type) throws RemotingException, InterruptedException, ExecutionException, TimeoutException;

    <T> CompletableFuture<T> call(String mainRoute, String subRoute, String endPoint, Object data, Class<T> type) throws RemotingException, InterruptedException;

    RpcManager findRpcManager(String name);
}
